package com.cuhk.gulimall.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
public class UserRegisterVo {

    @NotEmpty(message = "用户名不能为空")
    @Length(min = 1, max = 12, message = "用户名不得少于1个字符, 不得多于12个字符")
    private String username;

    @NotEmpty(message = "密码不能为空")
    @Pattern(regexp = "^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[!@#]).{8,}$", message = "密码格式有误")
    private String password;

    @NotEmpty(message = "二次输入密码不能为空")
    @Pattern(regexp = "^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[!@#]).{8,}$", message = "密码格式有误")
    private String curPassword;

    @NotEmpty(message = "电话号码不能为空")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$", message = "手机号格式不正确")
    private String phoneNumber;

    @NotEmpty(message = "验证码不能为空")
    private String verificationCode;

    // private boolean isAgreed;
}
